<html>
<body>
<?php
require("config.php");

if($_POST['login'] == ""){
?>
Register: 
<form action=register.php method=POST>
<table> 
<tr><td>Email: </td><td><input type=text name=email value=Email></td></tr> 
<tr><td>Login: </td><td><input type=text name=login value=Login></td></tr>
<tr><td>Password: </td><td><input type=password name=pass value=Password></td></tr>
</table>
<input type=Submit>
</form>
<?php
}elseif($_POST['login'] != "" && $_POST['pass'] != "" && $_POST['email'] != ""){
  $name = $_POST['login'];
  $pass = $_POST['pass'];
  $email = $_POST['email'];
  $pass = md5($pass);
  $query = "INSERT INTO $table VALUES('$name','$email','$pass')";
  $result = mysql_query($query);
  echo "Your information saved. <a href=index.php>Back</a>";
  mysql_close();
};
?>
</body>
</html>
